home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
tstrings.zip
/
TSTR.DOC
< prev
next >
Wrap
Text File
|
1991-12-10
|
4KB
|
126 lines
unit tStrings; {Null terminated Strings unit for Turbo Pascal 6}
{Throughout the documentation 'String' refers to a null
terminated
string apart from 'Pascal Style String' which refers to the
standard
counted string type}
type
PTChar = ^TChar;
TChar = array[0..65520] of char;
function locase(aChar : Char) : Char;
{Convert the Character aChar to lower Case}
function StrCat(aDest,aSource : pChar) : pChar;
{Concatenate aSource onto aDest and return a pointer to aDest}
function StrComp(Str1,Str2 : pChar) : integer;
{Compare Str1 with Str2
if Str1<Str2 then StrComp < 0
Str1=Str2 then StrComp = 0
Str1>Str2 then StrComp > 0
}
function StrCopy(aDest,aSource : PChar) : PChar;
{ Copy the contents of aSource to aDest and return a pointer to
aDest}
function StrCSpn(Str1,Str2 : pChar) : integer;
{ ***Not in windows Strings Unit
Returns the length of the String starting at Str1 that
consists
entirely of characters not in Str2}
function StrDispose(Var aChar : PChar) : pChar;
{Disposes of a string allocated with StrNew
EVEN IF the length has changed}
function StrECopy(aDest,aSource : pChar) : pChar;
{Copies a string from aSource to aDest and returns a pointer
to
the end of the string in aDest}
function StrEnd(aSource : pChar) : pChar;
{Returns a pointer to then end of the String in aSource
(in fact a pointer to the null terminator)}
function StrIComp(Str1,Str2 : pChar) : integer;
{Case insensitive compare
if Str1<Str2 then StrIComp < 0
Str1=Str2 then StrIComp = 0
Str1>Str2 then StrIComp > 0
}
function StrLCat(aDest,aSource : pChar;MaxLen : Word) : pChar;
{Concatenates the string aSource onto aDest. The string in
aDest will not become longer than Maxlen. The value
returned
by StrLCat is a pointer to aDest}
function StrLComp(str1,str2 : pChar; MaxLen : Word) : integer;
{Compares two strings up to a maximum length of Maxlen.
if Str1<Str2 then StrLComp < 0
Str1=Str2 then StrLComp = 0
Str1>Str2 then StrLComp > 0
If the strings have not differed up to Length Maxlen then
StrLComp=0}
function StrLCopy(aDest,aSource : pChar;Maxlen : Word) : pChar;
{Copies string aSource to aDest up to a maximum length
MaxLen. Returns a pointer to aDest}
function StrLen(aBuffer : PChar) : Integer;
{ Returns the length of String aBuffer}
function StrLIComp(Str1,Str2 : pChar;MaxLen : Word) : Integer;
{ Case Insensitive Compare of strings up to MaxLen
in length}
function Strlower(aBuffer : pChar) : pChar;
{ Converts the entire string to lower case}
function StrMove(aDest,aSource : pChar;Count : Word) : pChar;
{ Copies 'count' bytes from aSource to aDest}
function StrNew(aBuffer : Pchar) : PChar;
{ Allocates space on the heap large enough for aBuffer and
then copies aBuffer into the new string. Returns a pointer
to
the new string}
function StrPas(aBuffer : Pchar) : String;
{ Copies from a null terminated string to a pascal style
string}
function StrPCopy(aDest : pChar;aSource : String) : pChar;
{ Copies from a pascal style string to a null terminated
string}
function StrPos(Str1,Str2 : pChar) : Pchar;
{ Returns a pointer to the first occurrence of a string
in another string. If the string Str2 does not exist
in Str1 then the function returns nil}
function StrRScan(Str : pChar;Chr : Char) : pChar;
{Finds the last occurrence of character Chr in String Str.
If Chr does not exist in Str then returns a nil}
function StrScan(Str : pChar; Chr : Char) : pChar;
{Finds the first occurrence of character Chr in String
Str.
If Chr does not exist in Str then returns a nil}
function StrSpn(Str1,Str2 : pChar) : integer;
{Returns the length of string Str1 that consists entirely
of characters from Str2}
function StrUpper(aBuffer : pChar) : pChar;
{Converts the entire string 'aBuffer' to upper case
return a pointer to the start of the string}